import 'package:flutter/material.dart';
import 'package:flutter_chat_ui/views/chat_bottom_widgets/voice_controller.dart';
import 'package:get/get_state_manager/src/rx_flutter/rx_getx_widget.dart';

///
/// 显示语音转文本，解析后的内容视图
///
class SpeechToTextView extends StatelessWidget {
  const SpeechToTextView({super.key});

  @override
  Widget build(BuildContext context) {
    return RepaintBoundary(
      child: Padding(
        padding: const EdgeInsets.only(
          left: 24,
          right: 24,
        ),
        child: GetX<VoiceController>(builder: (controller) {
          return Text(
            controller.voiceToText.value,
            maxLines: 3,
            softWrap: true,
            style: const TextStyle(
              color: Colors.white,
              fontWeight: FontWeight.w600,
              fontSize: 16,
              overflow: TextOverflow.ellipsis,
            ),
          );
        }),
      ),
    );
  }
}
